package com.li.drug.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.li.drug.utils.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 账单信息记录
 */
@Data
@TableName(value = "billinfo")
public class Billinfo implements Serializable {
    //主键
    @TableField(value = "id")
    @TableId(value = "id",type = IdType.AUTO)  //主键自增
    private Integer id;

    private String sname;
    private String dname;
    private Integer count;
    private Float total;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date producttime;

    public String getDateFormat(){
        return DateUtil.dateConvert(producttime);
    }

}
